<template>
  <div class="xtx-home-page">
    <div class="home-entry">
      <div class="container">
        <!-- 左侧分类 -->
        <HomeCategory />
        <!-- 轮播图 -->
        <div class="home-banner">
          <XtxCarousel auto-play :sliders="bannerList"></XtxCarousel>
        </div>
      </div>

    </div>
    <!-- 新鲜好物 -->
    <HomeNew></HomeNew>
    <!-- 人气推荐 -->
    <HomeHot></HomeHot>
    <!-- 热门品牌 -->
    <HomeBrand></HomeBrand>
  </div>
</template>

<script>
import HomeCategory from './components/home-category'
// import HomePanel from './components/home-panel'
// 新鲜好物
import HomeNew from './components/home-new'
// 人气推荐
import HomeHot from './components/home-hot'
// 热门品牌
import HomeBrand from './components/home-brand.vue'

import { ref, onMounted } from 'vue'
import { getBannerAPI } from '@/api/category.js'
export default {
  name: 'XtxHomePage',
  props: {
    subTitle: {}
  },
  components: {
    HomeCategory,
    // HomePanel
    HomeNew,
    HomeHot,
    HomeBrand
  },
  setup() {
    const bannerList = ref([])
    const show = ref(true)
    onMounted(async () => {
      const data = await getBannerAPI()
      // console.log(data)
      bannerList.value = data.result
    })
    return { bannerList, show }
  }
}
</script>

<style lang="less" scoped>
// 淡入
.v-enter-from {
}
.v-enter-active {
}
.v-enter-to {
}

// 淡出
.v-leave-from {
  opacity: 1;
}
.v-leave-active {
  transition: all 2s;
}
.v-leave-to {
  opacity: 0;
}

// --------------------------
:root {
  --main-color: #464855;
}
.xtx-home-page {
  min-height: 600px;

  .home-banner {
    width: 1240px;
    height: 500px;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 98;
    .xtx-carousel {
      width: 100%;
      height: 100%;
      ::v-deep {
        .carousel-btn.prev {
          left: 270px !important;
        }
        .carousel-indicator {
          padding-left: 250px;
        }
      }
    }
  }
}
</style>